<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PetStore UOC - Practical Case</title>
</h:head>

<ui:composition template="./headerView.xhtml">
	<ui:define name="content">
		<br/>
 
		    <h:form rendered="#{!empty modifyShipping.shipping.address}">
		 	      
		    <p><b><font face="geneva,verdana,arial" size="4">Shipping Address Edition</font></b>
		    </p>
		    <table>
				
				<tr>
					<td align="right">Address:</td>
					<td align="left"><input type="text"   maxlength="100" name="addressSA" size="10" value="#{modifyShipping.shipping.address}"/></td>
				</tr>
				
		        <tr>
					<td align="right">City:</td>
					<td align="left"><input type="text"  maxlength="30" name="citySA" size="31" value="#{modifyShipping.shipping.city}"/></td>
				</tr>
				
				<tr>
					<td align="right">Postal Code:</td>
					<td align="left"><input type="text"  maxlength="5" name="postalCodeSA" size="31" value="#{modifyShipping.shipping.postalCode}"/></td>
				</tr>
		    </table>
		             
		          <p align="left">
		        	<h:commandButton value="Modify address" action="#{modifyShipping.setShippingAddressMBean}"/>
		          </p>
		          <br/><br/><br/>
		          <p align="left">
		        	<h:commandButton value="Back" immediate="true" action="#{modifyShipping.back}"/>
		          </p>
			</h:form>
			
			<h:form rendered="#{empty modifyShipping.shipping.address}">
		 	      
		    <p><b><font face="geneva,verdana,arial" size="4">Shipping Address Addition</font></b>
		    </p>
		    <table>
				
				<tr>
					<td align="right">Address:</td>
					<td align="left"><input type="text"   maxlength="100" name="addressSA" size="10" value="#{modifyShipping.shipping.address}"/></td>
				</tr>
				
		        <tr>
					<td align="right">City:</td>
					<td align="left"><input type="text"  maxlength="30" name="citySA" size="31" value="#{modifyShipping.shipping.city}"/></td>
				</tr>
				
				<tr>
					<td align="right">Postal Code:</td>
					<td align="left"><input type="text"  maxlength="5" name="postalCodeSA" size="31" value="#{modifyShipping.shipping.postalCode}"/></td>
				</tr>
		    </table>
		             
		          <p align="left">
		        	<h:commandButton value="Add address" action="#{modifyShipping.setShippingAddressMBean}"/>
		          </p>
		          <br/><br/><br/>
		          <p align="left">
		        	<h:commandButton value="Back" immediate="true" action="#{modifyShipping.back}"/>
		          </p>
			</h:form>


	</ui:define>
</ui:composition>
</html>
